﻿namespace Huayou.UI.WebControls
{
    using System;
    using System.ComponentModel;
    using System.Drawing;
    using System.Web.UI;

    [ToolboxBitmap(typeof(Dialog), "Huayou.UI.WebControls.Dialog.bmp"), DefaultProperty("Text"), ToolboxData("<{0}:Dialog runat=server></{0}:Dialog>")]
    public class Dialog : Panel
    {
        [DefaultValue(""), Bindable(true), Category("Appearance")]
        private string title = "";
        private Color titleColor = Color.Empty;

        protected override void CreateChildControls()
        {
            this.Controls.Add(new LiteralControl("<table width=100% border=0 ><tr><td></td><td style='CURSOR: default' bgcolor=\"" + this.titleColor.Name + "\">" + this.title + "</td><td></td></tr></table>"));
        }

        public string Title
        {
            get
            {
                return this.title;
            }
            set
            {
                this.title = value;
            }
        }

        public Color TitleColor
        {
            get
            {
                return this.titleColor;
            }
            set
            {
                this.titleColor = value;
            }
        }
    }
}

